package com.bhs.sansonglogistics.ui.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bhs.sansonglogistics.R;
import com.bhs.sansonglogistics.bean.DedicatedLineBean;
import com.bhs.sansonglogistics.bean.DedicatedLineDataBean;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * 升级和未升级专线
 */
public class QualityVoucherAdapter extends BaseQuickAdapter<DedicatedLineBean, BaseViewHolder> {

    private int type = 1;//1品质专线  2会员专线

    public QualityVoucherAdapter(int type) {
        super(R.layout.item_quality_voucher);
        this.type = type;
    }

    public QualityVoucherAdapter() {
        super(R.layout.item_quality_voucher);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, DedicatedLineBean item) {
        helper.setText(R.id.tv_start_city, item.getStart_city());
        helper.setText(R.id.tv_end_city, item.getEnd_city());
        helper.setImageResource(R.id.iv_status, item.isChecked() ? R.mipmap.ic_checked : R.mipmap.ic_unchecked);
        helper.setGone(R.id.iv_status, (type == 1 && item.getDeposit_status().equals("0")) || type == 2);
    }
}
